# -- coding:UTF-8 --
from inface import PersonService
from inface.constants import *
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol


tSocket = TSocket.TSocket('127.0.0.1', 8099)
transport = TTransport.TBufferedTransport(tSocket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
client = PersonService.Client(protocol)
# Connect!
transport.open()
person = Person("name",28,sex.FEMALE)
client.savePerson(person)
getPerson = client.getPerson("personId")
print getPerson
transport.close()